#ifndef _cpuid_h
#define _cpuid_h

typedef struct TAGcpuid_info_t {
 unsigned int eax;
 unsigned int ebx;
 unsigned int ecx;
 unsigned int edx;
} __attribute__((packed)) cpuid_info_t;

int cpuid_present();
void cpuid_vendor(char *);
void cpuid_info(int, cpuid_info_t *);


#define CPUID_FPU	(1<<0)
#define CPUID_VME	(1<<1)
#define CPUID_DE	(1<<2)
#define CPUID_PSE	(1<<3)
#define CPUID_TSC	(1<<4)
#define CPUID_MSR	(1<<5)
#define CPUID_PAE	(1<<6)
#define CPUID_MCE	(1<<7)
#define CPUID_CX8	(1<<8)
#define CPUID_APIC	(1<<9)
// reserved -------------------
#define CPUID_SEP	(1<<11)
#define CPUID_MTRR	(1<<12)
#define CPUID_PGE	(1<<13)
#define CPUID_MCA	(1<<14)
#define CPUID_CMOV	(1<<15)
#define CPUID_PAT	(1<<16)
#define CPUID_PSE36	(1<<17)
#define CPUID_PSN	(1<<18)
#define CPUID_CLFL	(1<<19) // as opposed to CPUID_FLCL
// reserved -------------------
#define CPUID_DTES	(1<<21)
#define CPUID_ACPI	(1<<22)
#define CPUID_MMX	(1<<23)
#define CPUID_FXSR	(1<<24)
#define CPUID_SSE	(1<<25)
#define CPUID_SSE2	(1<<26)
#define CPUID_SS	(1<<27)
#define CPUID_HTT	(1<<28)
#define CPUID_TM1	(1<<29)
#define CPUID_IA64	(1<<30)
#define CPUID_PBE	(1<<31)


#define CPUID_NEEDED_MASK (CPUID_FPU | CPUID_VME | CPUID_MSR | CPUID_PAE | CPUID_APIC | CPUID_PSE36)


#endif
